<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" >
							<div class="control-group" style="height:50px;">
								<label class="control-label">所属活动:</label>
								<div class="controls">
									<select class="form-control" style="width: 150px;" name="activity_id" id="activity">
										<option value="0">选择活动</option>
										<volist name="activity_list" id="vo">
											<option value='{$vo.activity_id}'>{$vo.activity_name|strip_tags}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">用户手机号 :</label>
								<div class="controls">
									<input type="text" placeholder="手机号" class="ui-wizard-content autoNext" maxlength="11" data-order='2' name="mobile_phone"   id="mobile_phone" onkeyup="value=value.replace(/[a-zA-z\.]+$/,'')" disabled/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">用户二维码 :</label>
								<div class="controls">
									<input type="text" placeholder="靓仔/美铝,你需要 拿扫描枪扫一下" class="ui-wizard-content autoNext"  maxlength="11" data-order='1' name="code_id"  id="code_id" onkeyup="value=value.replace(/[a-zA-z\.]+$/,'')" disabled/>
								</div>
							</div>
							<div class="form-actions">
								<button class="btn btn-success" type="button">提交</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('.autoNext').autoNext();
	//初始化登录用户名输入焦点
	tke_form_focus();
	$("button").click(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{$post_url}", $('form').serialize(), call_back, "json");
		return false;
		/**
		 * @todo 接收登录返回值
		 * @author PHP@妖孽 <dino_ma@163.com>
		 */
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				  if (data.url) {
						location.href=data.url;
					}else{
						location.reload();
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('ConfSign/add')}");

	//默认活动
	if("0" != "{:C('JJHH_ACTIVITY_ID')}"){
		set_value('activity_id', "{:C('JJHH_ACTIVITY_ID')}");
		$('#code_id').prop('disabled',false).val('');
		$('#mobile_phone').prop('disabled',false).val('');
	}
	//活动切换
	$('#activity').change(function(){
		if($(this).val()==0){
			$('#code_id').prop('disabled',true).val('');
			$('#mobile_phone').prop('disabled',true).val('');
		}else{
			$('#code_id').prop('disabled',false).val('');
			$('#mobile_phone').prop('disabled',false).val('');
		}
	});
});
</script>
</block>